﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LMA
{
  public partial class mainForm : Form
  {
    // Public hooks to form events
    public delegate void CommandEventHandler(/* Optional arguments */ );
    public event CommandEventHandler cmdCommand;
    public event CommandEventHandler sdlCommand;

    public mainForm() {
      // Build
      InitializeComponent();

     // Connect 
     // this code is now "autogenerated" and in mainForm.designer.cs
     // b_CMD.Click += new EventHandler(this.ForwardCommand1);
     // b_SDL.Click += new EventHandler(this.ForwardCommand2);
     // b_Exit.Click += new EventHandler(this.B_Exit_Click) ;
    }

    void ForwardCommand1(object sender, EventArgs e) {
      if(cmdCommand != null)
      	cmdCommand(/* Args according to declaration */);
    }

    void ForwardCommand2(object sender, EventArgs e)
    {
      if(sdlCommand != null)
      	sdlCommand() ;//"SDL") ;	//Args according to declaration
    }
    void B_Exit_Click(object sender, System.EventArgs e) {
    	this.Close() ;
    }
    
    void ListBox1SelectedIndexChanged(object sender, EventArgs e) {
    	switch (tabControl.SelectedTab.Text) {
    		case "CMD":
	 			//CMD_textBox.Text = listBox1.SelectedItem.ToString() ;
	 			break ;
	 		case "SDL":
	 			//SDL_textBox.Text = listBox1.SelectedItem.ToString() ;
	 			break ;
    	}
    	//MessageBox.Show(listBox1.SelectedItem.ToString()) ;
    }
  } // class
} // NameSpace LMA
